/**
 * Display runner history from given username and runType
 * @param args.username
 * @param args.runType
 */
function main()
{
	var url = "/gwi/run/runnerHistory.json?";
	var username = args.username;
	var runType = args.runType;
	if(username != null){
		url += "username=" + username;
	}
	if(runType != null){
		url += "&runType=" + runType;
	}
	var result = remote.call(url);
	var history = new Array(); 
	var runner;
	if (result.status == 200 && result != "{}"){
		var json = eval('(' + result + ')');
		history = json.history;
		runner = json.runner;
	}
	model.history = history;
	model.runner = runner;
}

main();